package cn.us.eagle.generic.service;

import java.io.Serializable;
import java.util.List;

/**
 * 共用式泛型Service接口类
 * 
 * @author ReasonZhong
 * 
 * @param <T>
 *            泛型类
 * @param <PK>
 *            泛型类主键
 */
public interface GenericService<T, PK extends Serializable> {

	public T save(T model);

	public void saveOrUpdate(T model);

	public void update(T model);

	public void merge(T model);

	public void delete(Class<T> entityClass, PK id);

	public void deleteObject(T model);

	public T get(Class<T> entityClass, PK id);

	public int countAll(Class<T> entityClass);

	public List<T> listAll(Class<T> entityClass);

}
